
    
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">编辑</h4>
                    </div>
                    <form class="form-horizontal m-t" id="myForm">
                        <div class="modal-body">
                            <!--错误信息提示-->
                            <div id="errormessage" class="alert alert-danger text-center" style="display:none">&nbsp;</div>
                            <input type="hidden" name="id" value="{{=ormdata.id}}" />

                            <div class="form-group">
                                <label class="col-sm-3 control-label">仓库名称</label>
                                <div class="col-sm-8">
                                    <input id="svn_name" name="svn_name" class="form-control" type="text" value="{{=ormdata.svn_name}}" placeholder="svn仓库名称">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">管理用户</label>
                                <div class="col-sm-8">
                                    <select multiple="multiple" placeholder="选择用户" id="users" name="users" class="search_user">
                                        {{<<html_user}}
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">用户名</label>
                                <div class="col-sm-8">
                                    <input id="svn_username" name="svn_username" class="form-control" type="text" value="{{=ormdata.svn_username}}" placeholder="svn登录用户名">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">密码</label>
                                <div class="col-sm-8">
                                    <input id="svn_passwd" name="svn_passwd" class="form-control" type="text" value="{{=ormdata.svn_passwd}}" placeholder="svn登录密码">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">URL地址</label>
                                <div class="col-sm-8">
                                    <input id="svn_url" name="svn_url" class="form-control" type="text" value="{{=ormdata.svn_url}}" placeholder="URL地址">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">本地源目录</label>
                                <div class="col-sm-8">
                                    <input id="svn_webdir_server" name="svn_webdir_server" class="form-control" type="text" value="{{=ormdata.svn_webdir_server}}" placeholder="本地源目录">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">忽略同步目录</label>
                                <div class="col-sm-8">
                                    <input id="rsync_ignore_dir" name="rsync_ignore_dir" class="form-control" type="text" value="{{=ormdata.rsync_ignore_dir}}" placeholder="使用逗号分割">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">客户端IP</label>
                                <div class="col-sm-8">
                                    <input id="svn_webip_client" name="svn_webip_client" class="form-control" type="text" value="{{=ormdata.svn_webip_client}}" placeholder="使用逗号分割">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">rsync模块</label>
                                <div class="col-sm-8">
                                    <input id="rsync_module" name="rsync_module" class="form-control" type="text" value="{{=ormdata.rsync_module}}" placeholder="rsync模块">
                                </div>
                            </div>
                        </div>
                        
                        <div class="modal-footer">
                            <button type="button" class="btn btn-white" data-dismiss="modal" >关闭</button>
                            <button type="submit" class="btn btn-primary">保存</button>
                        </div>
                        </form>


    
    <script>
        $('.search_user').SumoSelect({search: true, 
                                      searchText:'输入搜索字',
                                      noMatch : '没有找到匹配"{0}"的内容',
                                      okCancelInMulti: true, 
                                      selectAll: true,
                                      captionFormat: '{0} 个被选择',
                                      captionFormatAllSelected:'{0} 全部被选择',
                                      locale :  ['确定', '取消', '全选']
                                  });
        $(document).ready(function() {

            $("#myForm").validate({
                rules: {
                    svn_name : {
                        required : true
                    },
                    svn_username : {
                        required : true
                    },
                    svn_passwd : {
                        required : true
                    },
                    svn_url : {
                        required : true
                    },
                    svn_webdir_server : {
                        required : true
                    },
                    svn_webip_client : {
                        required : true
                    },
                    rsync_module : {
                        required : true
                    },
                },
                submitHandler: function(form) {  //通过之后回调
                    var data = $(form).serialize();
                     $.ajax({ 
                        url : "/webproject/subversionlistsave", 
                        type : "post", 
                        dataType : "json", 
                        data: data, 
                        success : function(d) { 
                            if (d.status==200){
                                $("#modaledit").modal('hide');
                                //刷新表格
                                $table.bootstrapTable('refresh');
                                swal({
                                    title: "操作成功",
                                    text: "2秒自动关闭",
                                    timer: 2000,
                                    type: "success",
                                    confirmButtonColor: "#DD6B55",
                                    confirmButtonText: "确定",
                                });
                            }else{
                                $("#errormessage").show().html("<h4>" + d.msg + "</h4>");
                            }
                        } 
                    }); 
                }, 
                invalidHandler: function(form, validator) {  //不通过回调 
                       return false; 
                } 
            });
            
        });
    </script>

